]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
network: Remove syncDescription
authorJasper St. Pierre <jstpierre@mecheye.net>
Wed, 17 Jul 2013 05:01:44 +0000 (01:01 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Sun, 28 Jul 2013 19:40:24 +0000 (15:40 -0400)
Replace it with setDeviceDescription, which gives device wrappers
more control about how to handle description changes.

https://bugzilla.gnome.org/show_bug.cgi?id=704670

js/ui/status/network.js

index 94f09d7618c255bdaafb4d5626e8535cb9a0de51..1da477a3e213239a406a82b4f25be040a6ac6c43 100644 (file)
@@ -179,6 +179,7 @@ const NMConnectionSection = new Lang.Class({
 
         this.item.status.text = this._getStatus();
         this.item.icon.icon_name = this._getMenuIcon();
+        this.item.label.text = this._getDescription();
     },
 
     _getStatus: function() {
@@ -211,10 +212,6 @@ const NMConnectionSection = new Lang.Class({
         return new NMConnectionItem(this, connection);
     },
 
-    syncDescription: function() {
-        this.item.label.text = this._getDescription();
-    },
-
     checkConnection: function(connection) {
         if (!this._connectionValid(connection))
             return;
@@ -328,8 +325,13 @@ const NMConnectionDevice = new Lang.Class({
         this._device.disconnect(null);
     },
 
+    setDeviceDescription: function(desc) {
+        this._description = desc;
+        this._sync();
+    },
+
     _getDescription: function() {
-        return this._device._description;
+        return this._description;
     },
 
     _sync: function() {
@@ -574,8 +576,6 @@ const NMVPNSection = new Lang.Class({
 
     _init: function(client) {
         this.parent(client);
-
-        this.syncDescription();
         this._sync();
     },
 
@@ -768,9 +768,9 @@ const NMApplet = new Lang.Class({
         let names = NMGtk.utils_disambiguate_device_names(this._nmDevices);
         for (let i = 0; i < this._nmDevices.length; i++) {
             let device = this._nmDevices[i];
-            device._description = names[i];
+            let description = names[i];
             if (device._delegate)
-                device._delegate.syncDescription();
+                device._delegate.setDeviceDescription(description);
         }
     },